

#define		MAX_SCANCODE		0x53	/* Ultimo valor de scancode */
/* Algunos scancodes significativos */
#define		BS_SCANCODE		0x0E
#define		ENTER_SCANCODE		0x1C
#define		LSHIFT_SCANCODE		0x2A
#define		RSHIFT_SCANCODE		0x36
#define		SPACE_SCANCODE		0x39
#define		CAPS			0x3A
#define		MASK_RELEASE	0x00000080
#define		MASK_SCAN	0x0000007F



/* Macros para detectar algunos scancodes significativos */
#define		IS_SHIFT(c)	( ( (c) == RSHIFT_SCANCODE) || ((c) == LSHIFT_SCANCODE ))
#define		IS_BS(c)	((c) == BS_SCANCODE)
#define		IS_ENTER(c)	((c) == ENTER_SCANCODE)
#define		IS_SPACE(c)	((c) == SPACE_SCANCODE)
#define		IS_CAPS(c)	((c) == CAPS)



static int mapkey[][MAX_SCANCODE+1] = 
{
	{
		0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',
		0, 0, 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']',
		0, 0, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '\\',
		0, 0, 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0, 0,
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
	},
	{
		0, 0, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
		0, 0, 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}',
		0, 0, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '\"', '|',
		0, 0, 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 0, 0,
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
	}
};
